package com.lagou.mr.test;

import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

import java.io.IOException;

public class RankMapper extends Mapper<LongWritable, Text, RankBean, NullWritable> {


    RankBean rankBean = new RankBean();

    @Override
    protected void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException {
        System.out.println("==> map.key = " + key + " ; map.value = " + value);
        rankBean.set_num(Integer.parseInt(value.toString()));
        context.write(rankBean, NullWritable.get());
    }
}
